Benjamin Otte [Mon, 19 Dec 2011 10:19:35 +0000 (11:19 +0100)]
x11: Unify focus handling code
This code was essentially copy-pasted in two locations, so unify them in
the same place.
https://bugzilla.gnome.org/show_bug.cgi?id=657578
Benjamin Otte [Sun, 18 Dec 2011 20:07:27 +0000 (21:07 +0100)]
a11y: implement widget_(un)set in ContainerCell
Benjamin Otte [Mon, 19 Dec 2011 05:10:16 +0000 (06:10 +0100)]
a11y: Make GtkCellAccessible a GtkAccessible
Benjamin Otte [Sun, 18 Dec 2011 19:25:23 +0000 (20:25 +0100)]
tests: Avoid deprecation warning
Benjamin Otte [Sun, 18 Dec 2011 19:24:46 +0000 (20:24 +0100)]
accessible: Deprecate gtk_accessible_connect_widget_destroyed()
That was an abomination. Also, if people called it twice, you got even
mor signal handlers!
Benjamin Otte [Sun, 18 Dec 2011 19:21:50 +0000 (20:21 +0100)]
widget: Set widget in accessible's constructor
No need to add t manually later.
Benjamin Otte [Sun, 18 Dec 2011 19:19:32 +0000 (20:19 +0100)]
a11y: Don't connect_destroyed anymore
It's not used now that set_widget() does the right thing.
Benjamin Otte [Sun, 18 Dec 2011 19:18:04 +0000 (20:18 +0100)]
iconview: Simplify adjustment monitoring for accessible
Benjamin Otte [Sun, 18 Dec 2011 18:21:07 +0000 (19:21 +0100)]
a11y: Remove widget_destroyed call
GtkAccessible does all of that for us now.
Benjamin Otte [Sun, 18 Dec 2011 18:20:15 +0000 (19:20 +0100)]
a11y: Use widget_unset vfunc in treeview
Benjamin Otte [Sun, 18 Dec 2011 16:29:31 +0000 (17:29 +0100)]
accessible: Ensure we unset the widget when finalizing
Benjamin Otte [Sun, 18 Dec 2011 16:18:49 +0000 (17:18 +0100)]
widget: Unref accessible
Benjamin Otte [Sun, 18 Dec 2011 16:14:47 +0000 (17:14 +0100)]
a11y: Fix crash in notebook
When the accessible was disposed before the notebook it referenced, the
weak ref could still trigger. This works around it.
Benjamin Otte [Sun, 18 Dec 2011 16:05:20 +0000 (17:05 +0100)]
widget: Unset self from accessible
Benjamin Otte [Sun, 18 Dec 2011 15:55:14 +0000 (16:55 +0100)]
widget: Unset widget on accessibles
Benjamin Otte [Sun, 18 Dec 2011 15:41:06 +0000 (16:41 +0100)]
accesible: Manage the DEFUNCT state
A GtkAccessible with a NULL widget is defunct, there's no way around it.
Benjamin Otte [Sun, 18 Dec 2011 15:16:34 +0000 (16:16 +0100)]
iconview: Split out iconview accessible
Benjamin Otte [Sun, 18 Dec 2011 12:07:07 +0000 (13:07 +0100)]
accessible: Use set_widget() in destroy notify
We don't want to bypass the unset_widget call.
Benjamin Otte [Sun, 18 Dec 2011 11:55:41 +0000 (12:55 +0100)]
API: accessible: Add widget_set and widget_unset vfuncs
I expect them to be used a lot, so this approach seems better than
requiring signals that connect to "notify::widget". Also, we can't use
regular functions (like dispose or constructed), becaiuse those assume
that (un)setting of the widget only happens once and with the current
design (a puble set_widget() function) we can't really guarantee that.
Also, I split them into two separate functions as one function is part
of construction and the other part of destruction of the object. And it
doesn't sound like a good idea to have that both be part of one
function.
Benjamin Otte [Sun, 18 Dec 2011 11:49:06 +0000 (12:49 +0100)]
accessible: At an important note to the docs
I wanted to use weak refs to ensure this instead, but it's a performance
problem when used in the treeview and each and every cell adds a weak
ref to the treeview.
Benjamin Otte [Sun, 18 Dec 2011 06:30:23 +0000 (07:30 +0100)]
accessible: Check the widgeyt actually changed when setting
Benjamin Otte [Sun, 18 Dec 2011 05:55:44 +0000 (06:55 +0100)]
accessible: Make widget a property
Benjamin Otte [Sat, 17 Dec 2011 19:45:07 +0000 (20:45 +0100)]
treeview: Only set focus column in setter function
Single point of entry. It's actually going to become more complicated
with a11y now.
Benjamin Otte [Fri, 16 Dec 2011 22:11:45 +0000 (23:11 +0100)]
a11y: Simplify code
Use peek_cell() instead of a custom find_cell() function that duplicates
loads of functionality.
Matthias Clasen [Mon, 19 Dec 2011 12:32:32 +0000 (07:32 -0500)]
Tell gtk-doc about G_GNUC_WARN_UNUSED_RESULT
Matthias Clasen [Mon, 19 Dec 2011 12:32:15 +0000 (07:32 -0500)]
Reduce gtk-doc warnings
Matthias Clasen [Sun, 18 Dec 2011 21:04:51 +0000 (16:04 -0500)]
Fix parameter name mismatch
Matthias Clasen [Sun, 18 Dec 2011 19:28:01 +0000 (14:28 -0500)]
Use the workarea when placing popups
This uses the new workarea API to avoid placing popups underneath
panels, docks, etc.
Matthias Clasen [Sun, 18 Dec 2011 19:02:55 +0000 (14:02 -0500)]
Add gdk_screen_get_monitor_workarea
The function returns the part of a monitors area that should be
used for positioning popups, menus, etc. The only non-trivial
implementation atm is in the X backend, all the other backends
just return the full monitor area. The X implementation is
currently suboptimal, since it requires roundtrips to collect
the necessary information. It should be changed to monitor
the properties for changes, when XFixes allows to monitor
individual properties.
https://bugzilla.gnome.org/show_bug.cgi?id=641999
Daniel Mustieles [Sun, 18 Dec 2011 19:11:34 +0000 (20:11 +0100)]
Updated Spanish translation
Carlos Garnacho [Sun, 18 Dec 2011 17:56:51 +0000 (18:56 +0100)]
gdk,xi2: Make more resilient about not yet known devices
Dealing with disabled devices may turn into hierarchy/device
changed events on device IDs with no backing GdkDevice yet,
so protect against that. The device attachment will be handled
correctly when the device is enabled later.
Ignacio Casal Quinteiro [Sun, 18 Dec 2011 17:45:49 +0000 (18:45 +0100)]
textlayout: cleanup
Use g_clear_object, move unrefs to dispose and reorganize code
Paolo Borelli [Sun, 18 Dec 2011 16:44:23 +0000 (17:44 +0100)]
Use gtk_text_layout_get_iter_at_line
We already have a gtk_text_layout_get_iter_at_line wrapper that takes
care of getting the btree from the layout, we may as well use it.
Paolo Borelli [Sun, 18 Dec 2011 16:35:08 +0000 (17:35 +0100)]
Remove useless get_iter_at_line calls.
No need to call _gtk_text_btree_get_iter_at_line right before calling
totally_invisible_line, since it is the first thing it does itself.
Baurzhan Muftakhidinov [Sat, 17 Dec 2011 20:11:15 +0000 (21:11 +0100)]
[l10n] Updated Kazakh translation
Piotr Drąg [Sat, 17 Dec 2011 18:50:27 +0000 (19:50 +0100)]
Updated POTFILES.in
Rui Matos [Sat, 17 Dec 2011 11:51:35 +0000 (11:51 +0000)]
tests: Add a test for latest commit
https://bugzilla.gnome.org/show_bug.cgi?id=666392
Rui Matos [Fri, 16 Dec 2011 23:46:19 +0000 (23:46 +0000)]
widget: Flip the sensitive flag even if the state doesn't change
Even if we can't change our sensitivity because the parent is insensitive we
should still flip the sensitive flag. Otherwise, with and insensitive parent,
child.set_sensitive(True)
...
parent.set_sensitive(True)
would result in child still being insensitive.
https://bugzilla.gnome.org/show_bug.cgi?id=666392
Benjamin Otte [Fri, 16 Dec 2011 18:52:46 +0000 (19:52 +0100)]
filechooserentry: Catch tab key earlier
Instead of in the key_press handler, use a signal handler. The signal
handler runs before the default handler, and before other signal
handlers. In particular it runs before the signal handler installed via
gtk_entry_set_completion() which pops down the entry completion, and we
don't want that to happen.
The code does not change the code of the handler in any significant way,
it just refacotrs it to not call the parent anymore.
https://bugzilla.gnome.org/show_bug.cgi?id=663573
Benjamin Otte [Fri, 16 Dec 2011 17:47:42 +0000 (18:47 +0100)]
filechooserentry: Do inline completion only when opening files
When saving files, using <tab> is required. We don't want the UI
randomly changing filenames from below us.
https://bugzilla.gnome.org/show_bug.cgi?id=663573
Benjamin Otte [Fri, 16 Dec 2011 17:32:25 +0000 (18:32 +0100)]
filechooserentry: Remove unused enum
Benjamin Otte [Fri, 16 Dec 2011 17:24:24 +0000 (18:24 +0100)]
filechooserentry: Allow NULL as base folder again
This was removed previously, but is necessary to support the case where
no base folder is in use, which should cause an error. This can be
experienced in save mode in the recent files list.
https://bugzilla.gnome.org/show_bug.cgi?id=663573
Benjamin Otte [Mon, 7 Nov 2011 14:02:34 +0000 (15:02 +0100)]
filechooserentry: Don't show files when selecting directory
We don't want to complete on files when they're not supposed to be
selectable.
Benjamin Otte [Mon, 7 Nov 2011 04:27:00 +0000 (05:27 +0100)]
filechooserentry: Remove beep function
There's only 2 places left where we potentially beep. We can call
gtk_widget_error_bell() directly there.
Benjamin Otte [Mon, 7 Nov 2011 04:22:52 +0000 (05:22 +0100)]
filechooserentry: Simplify load completion
Most importantly, consistently trigger a beep when we abort a pending
completion.
Benjamin Otte [Mon, 7 Nov 2011 04:08:46 +0000 (05:08 +0100)]
filechooserentry: Use a GtkFileFilter for filtering
That way, we can use the regular filtering features of the
filesystemmodel instead of having our own filtering function that
duplicates much of the matching code.
This also removes the broken-on-windows feature where files strting with
a dot were not autocompleted.
Benjamin Otte [Mon, 7 Nov 2011 14:18:40 +0000 (15:18 +0100)]
filesystemmodel: Add a toggle for whether directories are filtered
Benjamin Otte [Mon, 7 Nov 2011 03:30:04 +0000 (04:30 +0100)]
filechooserentry: Remove the file column
It is not needed anymore.
Benjamin Otte [Mon, 7 Nov 2011 03:20:28 +0000 (04:20 +0100)]
filechooserentry: Simplify code
Use all the clever functions we invented in recent refactorings to
compute the file and dir part and the current folder.
This also fixes the bug where "./" was not taken as the current
directory but interpreted as a file named "./".
Benjamin Otte [Mon, 7 Nov 2011 03:12:49 +0000 (04:12 +0100)]
filechooserentry: Refactor function
Name the function set_completion_folder() and make it accept NULL, so it
behaves like a regular setter function.
Benjamin Otte [Mon, 7 Nov 2011 02:51:25 +0000 (03:51 +0100)]
filechooserentry: Set minimum key length to 0
We want the empty chooser to show possible completions, too.
Benjamin Otte [Mon, 7 Nov 2011 02:40:16 +0000 (03:40 +0100)]
filechooserentry: Simplify refresh_current_folder_and_file_part()
The function can get the text it's refreshing from itself, as there is
only one possible value. And it doesn't need to return a value anymore.
Benjamin Otte [Mon, 7 Nov 2011 02:34:41 +0000 (03:34 +0100)]
filechooserentry: Get rid of unused member variable
in_change isn't set anymore.
Benjamin Otte [Mon, 7 Nov 2011 02:33:18 +0000 (03:33 +0100)]
filechooserentry: Remove _gtk_file_chooser_entry_set_file_part()
gtk_entry_set_text() is fine.
Benjamin Otte [Mon, 7 Nov 2011 02:22:26 +0000 (03:22 +0100)]
filechooserentry: Use completion for completion
Reduce the amount of code even more by using the entry completion to
query the prefix.
Benjamin Otte [Mon, 7 Nov 2011 02:09:22 +0000 (03:09 +0100)]
filechooserentry: Add gtk_file_chooser_entry_get_completion_text()
This returns the text that should be completed on. As this is somewhat
tricky to compute (and in fact one place did it wrong), let's make it a
function.
Benjamin Otte [Mon, 7 Nov 2011 01:58:26 +0000 (02:58 +0100)]
filechooserentry: Don't update the folder when completing
The folder is always up to date, there's no need to update it. (If the
folder is not up to date, that is a bug and needs to be fixed
elsewhere.)
Benjamin Otte [Mon, 7 Nov 2011 01:53:05 +0000 (02:53 +0100)]
filechooserentry: Don't override activate
The code is no longer necessary, because the relevant parts for inline
completion are now handled by GtkEntry.
Benjamin Otte [Mon, 7 Nov 2011 01:39:02 +0000 (02:39 +0100)]
filechooserentry: Simplify append_common_prefix()
Now that we don't need to know anymore why insertion failed, we can
simplify the append function quite a lot.
A simple rule now: If we did not insert anything, beep.
Benjamin Otte [Mon, 7 Nov 2011 01:30:06 +0000 (02:30 +0100)]
filechooserentry: Remove completion feedback
Too much special code for no gain.
I did a totally unscientific questionnaire on GNOME IRC (assuming
autocompletion is for advanced users) and nobody even knew what this is.
So I suspect it's useless. Also, it's positioned completely wrong anyway
and nobody noticed so far. Last but not least, I'm trying to imitate
bash here and bash doesn't show feedback.
Benjamin Otte [Mon, 7 Nov 2011 01:16:43 +0000 (02:16 +0100)]
filechooserentry: Redo completion popup trigger
Use dispatch_properties_changed() instead of GtkEditable to watch for
changes to the to-be-completed text. This is necessary because various
functions in GtkEntry don't use the interface vfuncs and one only
becomes aware of them via notifications. I'm not sure this is intended
behavior, but it's how it works today.
Also, use the same code for triggering in all situations.
What the code does is this: It looks at the part of the text in front of
the cursor (or selection) and completes for it. Once the directory has
been enumerated, inline completion is activated. Note that popping up of
the completion popup is completely handled by GtkEntry.
Benjamin Otte [Sun, 6 Nov 2011 02:52:41 +0000 (03:52 +0100)]
filechooserentry: Get rid of RefreshMode
Instead, pass the text to use to refresh_current_folder_and_file_part().
This also gets rid of the problem introduced earlier that the position
is not properly updated in do_insert_text() and therefor the completion
is wrong.
Benjamin Otte [Sun, 6 Nov 2011 02:00:47 +0000 (03:00 +0100)]
filechooserentry: Use inline completion
... from GtkEntryCompletion instead of implementing a poor copy
ourselves. This also makes the file chooser entry behave a lot closer to
normal entries.
Benjamin Otte [Sun, 6 Nov 2011 01:47:36 +0000 (02:47 +0100)]
filechooserentry: Merge function
Benjamin Otte [Sun, 6 Nov 2011 01:33:57 +0000 (02:33 +0100)]
filechooserentry: Set the text column of the entry completion
I want to use it in the next commits, but am doing this in a separate
commit so we can find side effects causing bugs easier when bisecting.
Benjamin Otte [Sun, 6 Nov 2011 01:21:28 +0000 (02:21 +0100)]
filechooserentry: Simplify match_selected function
Benjamin Otte [Sat, 5 Nov 2011 21:31:40 +0000 (22:31 +0100)]
filechooserentry: Keep an extra column for the full path
This is identical to the display name when not having a path that
changes the folder. Otherwise it will have the full path that was
entered in the entry. Say when from your home dir, you type
"../../usr/li", the full path for "lib" and "lib64" will be
"../../usr/lib" and "../../usr/lib64" respectively. This value isn't
used yet, but will be soon.
Benjamin Otte [Sat, 5 Nov 2011 19:38:28 +0000 (20:38 +0100)]
entrycompletion: Export gtk_entry_completion_compute_prefix()
I want to use it in the file chooser entry autocomplete code.
Benjamin Otte [Sat, 5 Nov 2011 02:56:36 +0000 (03:56 +0100)]
filechooserentry: Redo _gtk_file_chooser_entry_get_file_part()
The new version does not need to update any text, it just strips the
last part of the existing entry.
Benjamin Otte [Sat, 5 Nov 2011 02:53:32 +0000 (03:53 +0100)]
filechooserentry: Modify _gtk_file_chooser_entry_get_current_folder()
The new version does not need to muck with the entry, it just extracts
the required information. It returns a reference to the folder though,
as we extract the information now instead of returning something stored.
Benjamin Otte [Sat, 5 Nov 2011 02:28:02 +0000 (03:28 +0100)]
filechooserentry: Split out function
I want to use that function elsewhere, so split it out.
Benjamin Otte [Sat, 5 Nov 2011 01:51:59 +0000 (02:51 +0100)]
filechooserentry: Simplify code
Now that the base folder is always != NULL, we can remove the parts of
the code that check for NULL.
Benjamin Otte [Sat, 5 Nov 2011 01:31:04 +0000 (02:31 +0100)]
filechooserentry: Ensure the base folder is always valid
If the base folder is set to NULL, then we just assume the home dir.
FIXME: Should we disallow a NULL folder?
Benjamin Otte [Sat, 5 Nov 2011 00:53:55 +0000 (01:53 +0100)]
filechooserentry: Don't complain about incomplete hostnames
First of all, those hostnames may very well be complete, second of all,
smb:// is a valid uri to enter.
Benjamin Otte [Fri, 4 Nov 2011 23:14:39 +0000 (00:14 +0100)]
filechooserentry: Start autocomplete immediately
Don't do idle handlers for this.
Benjamin Otte [Fri, 4 Nov 2011 16:02:23 +0000 (17:02 +0100)]
filechooserentry: Remove file_system argument
It's not needed anymore.
Benjamin Otte [Fri, 4 Nov 2011 15:33:58 +0000 (16:33 +0100)]
filechooserentry: Simplify code
Now that we've imported the function in the last commit, rename it and
omit useless arguments by instead passing in the entry directly.
Benjamin Otte [Fri, 4 Nov 2011 15:14:01 +0000 (16:14 +0100)]
filechooserentry: Move _gtk_file_system_parse()
It's very specific to the file chooser entry, so it's better kept there.
It's also not used anywhere else in the code.
Benjamin Otte [Thu, 3 Nov 2011 21:19:57 +0000 (22:19 +0100)]
gtkfolder: Remove
It's not used anymore. And new code should of course use gio.
Benjamin Otte [Thu, 3 Nov 2011 17:27:36 +0000 (18:27 +0100)]
filechooserentry: Use a GtkFileSystemModel
Replace the usage of a list store and a GtkFolder with a
GtkFileSystemModel. This improves performance and reduces code size.
Benjamin Otte [Thu, 3 Nov 2011 17:11:14 +0000 (18:11 +0100)]
filechooserentry: Store the liststore as a treemodel
Just changes the type of the member variable. This way we can avoid a
lot of casts.
Benjamin Otte [Thu, 3 Nov 2011 16:46:47 +0000 (17:46 +0100)]
filechooserentry: Make appending / to directories simpler
Benjamin Otte [Thu, 3 Nov 2011 16:32:44 +0000 (17:32 +0100)]
filechooserentry: Only append / to directory names once
Since
069d78ed31fc1c0a9cb7621d27fe10d7b974315b the / is appended to
directories upon constructing the display name, so there is no need to
do it later.
Benjamin Otte [Thu, 3 Nov 2011 21:05:38 +0000 (22:05 +0100)]
filechooserentry: Don't trim away the slash after directories
It's not necessary as the code appending the slashes checks for a slash
these days.
Benjamin Otte [Thu, 3 Nov 2011 14:20:28 +0000 (15:20 +0100)]
filechooserentry: Fold in start_loading_current_folder()
The function just did one thing, we can just fold it into the only
caller.
Benjamin Otte [Thu, 3 Nov 2011 14:13:17 +0000 (15:13 +0100)]
filechooserentry: The file system cannot be NULL
Remove code that checked this.
Benjamin Otte [Thu, 3 Nov 2011 14:12:17 +0000 (15:12 +0100)]
filechooserentry: Make the filesystem a construct-only argument
This allows simplifications in the code.
Benjamin Otte [Thu, 3 Nov 2011 13:11:57 +0000 (14:11 +0100)]
filechooserentry: Keep finished_loading variable ourselves
This will be useful in the next commits when the GtkFolder code
previously keeping that variable gets repalced.
Benjamin Otte [Fri, 28 Oct 2011 20:35:04 +0000 (13:35 -0700)]
filechooserentry: force_reload is never TRUE
.. so remove it.
Benjamin Otte [Fri, 28 Oct 2011 20:19:15 +0000 (13:19 -0700)]
filechooserentry: Fold function into other
There's no need to discard the current folder's file without also
discarding the folder object.
Benjamin Otte [Fri, 28 Oct 2011 12:38:11 +0000 (05:38 -0700)]
filechooserentry: Reorganize function
Setter functions the way I code it look like this (in order):
1) Figure out if the value changed. If not, exit early.
2) Clear the old value (ie unref stuff, disconnect signals
3) Copy the new value
4) Set up things about the new value
This reorganization does that.
And by doing that, it even reduces the amount of code and the amount of
branches (and with it, nesting) needed.
Benjamin Otte [Fri, 28 Oct 2011 03:00:20 +0000 (20:00 -0700)]
filechooserentry: Use the actual discarding function to discard a folder
Benjamin Otte [Sat, 5 Nov 2011 21:36:16 +0000 (22:36 +0100)]
filechooserentry: Don't use a magic number
... when we have a proper enum value for a column.
Benjamin Otte [Sun, 6 Nov 2011 17:47:28 +0000 (18:47 +0100)]
entry: Move freeze/thaw into begin/end_change
Benjamin Otte [Thu, 3 Nov 2011 21:03:22 +0000 (22:03 +0100)]
entry: Don't try to handle Tab in entry completions
Instead, fall through to the default handler after closing the
completion. This has the advantage of letting the file chooser entry
capture the tab key properly, so one can't accidentally move out of the
entry by pressing tab while the completion is popped up.
I also suspect it fixes bugs with weird tab keys and shift/ctrl
oddities. But who knows...
Daniel Mustieles [Fri, 16 Dec 2011 13:22:49 +0000 (14:22 +0100)]
Updated Spanish translation
Benjamin Otte [Fri, 16 Dec 2011 12:38:06 +0000 (13:38 +0100)]
tests: Relax a refcount comparison check
We now test for real_refcount >= expected_refcount, because various
parts of the code (a11y, selection, cursor, ...) can and do add
references.
Benjamin Otte [Fri, 16 Dec 2011 11:57:06 +0000 (12:57 +0100)]
a11y: Don't emit children-changed when nothing changed
When we have 0 columns, no children ever get added or removed.
Benjamin Otte [Fri, 16 Dec 2011 10:43:16 +0000 (11:43 +0100)]
treeview: Run unref helper for all rows
Don't do shortcuts. Because all rows need to be unreffed.
Introduced in
92929b968bd479e237b8f6dc1686ca953f4d8c5d.
Matthias Clasen [Fri, 16 Dec 2011 04:59:36 +0000 (23:59 -0500)]
Updates